package feat;

import org.junit.jupiter.api.Test;
import org.noear.solon.ai.mcp.client.McpClientProvider;
import org.noear.solon.ai.media.Text;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wyl
 * @date 2025年05月03日 下午5:25
 */
public class McpClientTest1 {

    @Test
    public void case1() {
        McpClientProvider mcpClient = new McpClientProvider("http://localhost:5998/mcp/sse");
        mcpClient.getTools();

        Map<String, Object> args = new HashMap<>();
        args.put("location", "杭州");
        Text rst = mcpClient.callToolAsText("getWeather", args);
        mcpClient.close();
    }

}
